package com.koron.order.linedefect.base.bean.po;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.koron.bean.base.BaseBean;
import com.koron.order.linedefect.base.excel.DefectVOContractConvertor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @ClassName DedectBean
 * @description
 * @Author zhouj
 * @Date 2021/9/1 15:13
 */
@ExcelIgnoreUnannotated
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel("缺陷基础信息表")
public class DefectBean extends BaseBean {

    @ExcelProperty(value = "编码",index = 1)
    @ApiModelProperty(value = "缺陷工单编码")
    private String code;

    @ExcelProperty(value = "标题",index = 2)
    @ApiModelProperty(value = "缺陷工单标题")
    private String title;

    @ApiModelProperty(value = "缺陷工单类型，这里作为作废原因字段")
    private String type;

    @ApiModelProperty(value = "缺陷工单来源 defect_source")
    private String source;

    @ApiModelProperty(value = "巡视工单id")
    private String patrolId;

    @ApiModelProperty(value = "设备ID")
    private String equipmentId;

    @ExcelProperty(value = "设备",index = 4)
    @ApiModelProperty(value = "设备名称")
    private String equipmentName;

    @ApiModelProperty(value = "设备管理单位ID")
    private String deptManage;

    @ExcelProperty(value = "设备管理单位",index = 3)
    @ApiModelProperty(value = "设备管理单位名称")
    private String deptManageName;

    @ExcelProperty(value = "专业",order = 6,converter = DefectVOContractConvertor.class)
    @ApiModelProperty(value = "专业")
    private String major;

    @ApiModelProperty(value = "缺陷等级")
    private String level;

    @ApiModelProperty(value = "缺陷发现人类型")
    private String finderType;

    @ApiModelProperty(value = "缺陷发现人")
    private String finder;

    @ExcelProperty(value = "发现人",index = 9)
    @ApiModelProperty(value = "缺陷发现人名字")
    private String finderName;

    @ExcelProperty(value = "发现时间",index = 10)
    @ApiModelProperty(value = "缺陷发现时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date findTime;

    @ApiModelProperty(value = "缺陷关键字Id(缺陷表象)")
    private String keysId;

    @ExcelProperty(value = "缺陷关键字",index = 5)
    @ApiModelProperty(value = "缺陷关键字(缺陷表象)")
    private String keys;

    @ApiModelProperty(value = "缺陷描述")
    private String desc;

    @ApiModelProperty(value = "缺陷预采取措施")
    private String measure;

    @ApiModelProperty(value = "缺陷建议")
    private String suggestion;

    @ApiModelProperty(value = "缺陷备注")
    private String remarks;

    @ExcelProperty(value = "状态",index = 0,converter = DefectVOContractConvertor.class)
    @ApiModelProperty(value = "工单状态")
    private String status;

    @ApiModelProperty(value = "应完成处理时间(应完成处理时间=审批通过时间+消缺期限)")
    private Date expectEndTime;

    @ApiModelProperty(value = "实际完成时间")
    private Date factEndTime;

    @ApiModelProperty(value = "处理方式 risk_handler_way")
    private String handlerWay;

    @ApiModelProperty(value = "缺陷类型 defect_category")
    private String category;

    @ApiModelProperty(value = "巡视工单来源类型 line_patrol_type")
    private String patrolType;

    // 缺陷工单类型，这里作为作废原因字段
    public String getCancelReason() {
        return type;
    }
    public void setCancelReason(String cancelReason) {
        this.type = cancelReason;
    }

}
